import axios from 'axios'
import { React, useState, useEffect } from "react";
import InterIP from "../../IP/IP";
export default function IntegralId_Details() {
  const [details, setDetails] = useState([]);
  useEffect(() => {
    let IP = InterIP().props.children;
    let integralId = localStorage.getItem('integralId')
    axios.post('http://' + IP + ':3000/index/selIntegral/single', {
      integral_id: integralId,
    }).then((res) => {
      setDetails((details) => details = res.data);
    })
  }, [])
  return (
    <div>
      {details.map((data, key) =>
        <div className="product_details" key={key}>
          <div>{data.integral_introduce}</div>
          <div>
            <img src={data.integral_img} alt="" />
          </div>
        </div>
      )}
    </div>
  )
}
